/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.xilin.data

import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.beans.PropertyEditorRegistrar;
import org.springframework.beans.PropertyEditorRegistry;
import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.context.i18n.LocaleContextHolder;

class CustomPropertyEditorRegistrar implements PropertyEditorRegistrar {
    def messageSource;

    public void registerCustomEditors(PropertyEditorRegistry registry) {
        registry.registerCustomEditor(Date.class, new CustomDateEditor(new SimpleDateFormat(messageSource.getMessage("dateFormatUS", null, 'MM/dd/yyyy', LocaleContextHolder.locale )),true));
    }
	
}